[docs] Document project serverReadyAction override in VS Code extension - #1459
[docs] Document project serverReadyAction override in VS Code extension#1459aspire-repo-bot[bot] wants to merge 5 commits into
Conversation
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
There was a problem hiding this comment.
Pull request overview
Documents how the Aspire VS Code extension handles serverReadyAction for C#/.NET projects, specifically clarifying that users can override the extension-generated default.
Changes:
- Adds guidance explaining that a generated
serverReadyActioncan be overridden via launch configuration. - Adds a JSON example showing how to set a custom
serverReadyActionpattern/action.
Suppressed comments (1)
src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdx:141
- This JSON example is presented as a full
.vscode/launch.jsonlaunch configuration, but it only contains thedebuggersproperty. For consistency with the other examples in this page (and to avoid copy/paste confusion), include the standard Aspire launch configuration fields (type,request,name,program) alongsidedebuggers.
{
"debuggers": {
"project": {
"serverReadyAction": {
"action": "openIntegratedBrowser",
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Adam Ratzman (adamint)
left a comment
There was a problem hiding this comment.
I left two inline comments: debuggers.project also applies to the .NET AppHost, and the sample pattern truncates IPv6 URLs. The existing Copilot feedback already covers the property path and incomplete launch.json shape.
David Pine (IEvangelist)
left a comment
There was a problem hiding this comment.
🤖 Automated docs-accuracy review — ⚠️ changes requested
Phase A source of truth: microsoft/aspire @ release/13.5 (SHA 1d922813c0f9bc14f7d817c817a8ab46b288bb44) — the branch this PR targets.
Claims extracted: 3 non-narrative → 1 verified, 1 contradicted, 1 unverifiable, 0 verified-with-nuance.
Phase B (doc-tester): exercised /get-started/aspire-vscode-extension/ on a local dev server serving this PR — page renders (HTTP 200), 0 critical, 0 warnings.
Headline
The new section documents a debuggers.project.serverReadyAction override that is not implemented on release/13.5. On this branch the extension unconditionally overwrites any user-supplied serverReadyAction for project resources, so the documented override has no effect. The mechanism that makes it work exists on main (guarded by serverReadyAction === undefined), so this doc appears to have landed on the release branch ahead of the code. See the two inline comments for the exact source evidence.
Phase A — Claim verification
Two inline comments are anchored to the affected lines (the contradicted override claim, and the openIntegratedBrowser example that doesn't exist on this branch).
✅ Verified claims (1) with evidence
Source (all microsoft/aspire@release/13.5): extension/src/debugger/languages/dotnet.ts, extension/src/debugger/debuggerExtensions.ts, extension/src/debugger/launchProfiles.ts, extension/src/test/dotnetDebugger.test.ts.
- "For
project, the extension normally generates aserverReadyActionfrom the project'slaunchSettings.jsonto automatically open the browser when the server is ready." (config/behavior) — verified.
dotnet.ts:451-452setsdebugConfiguration.serverReadyAction = determineServerReadyAction(baseProfile?.launchBrowser, baseProfile?.applicationUrl, baseProfile?.launchUrl)for every non-AppHost (project) resource.determineServerReadyAction(launchProfiles.ts:368-383) reads those launch-profile fields and returns{ action: "openExternally", pattern: "\\bNow listening on:\\s+https?://\\S+", uriFormat }. Corroborated bydotnetDebugger.test.ts:1736-1738("serverReadyAction should be present with the applicationUrl").
Minor nuance: the generated action isopenExternally(opens the external browser), and it is only produced when the profile haslaunchBrowser: trueand anapplicationUrl; otherwise none is generated.
Phase B — Doc-tester results (blind "new user" pass, no source code consulted)
Route exercised: /get-started/aspire-vscode-extension/ (served from a local Astro dev server with this PR's content; navigated via playwright-cli).
✅ Passed checks
- Page compiles and returns HTTP 200; title "Aspire Visual Studio Code extension | Aspire". No MDX/compile errors, no browser console errors.
- The new paragraph renders with correct inline-code formatting (
serverReadyAction,launchSettings.json,project.serverReadyAction). - The new JSON block renders with its title ".vscode/launch.json — override the generated serverReadyAction", correct syntax highlighting, and a working copy button; it is placed logically between the
debuggers-keys paragraph and the followingenv/argsparagraph.
🔴 Critical issues
- None (rendering).
⚠️ Warnings
- None.
💡 Recommendations / knowledge gaps (minor, non-blocking)
- The allowed
actionvalues aren't enumerated, so a reader can't tell what is valid besides theopenIntegratedBrowsershown. - The relationship between the
patterncapture group and the URL the browser opens isn't explained.
Blind-user note: nothing on the rendered page reveals the accuracy problem — it reads as a well-formed, working feature. The mismatch is only detectable by checking the extension source on the target branch (Phase A). This is the intended division of labor between the two phases.
Verdict
REQUEST_CHANGES — one contradicted claim: the documented project.serverReadyAction override does not function on release/13.5 (the user value is silently overwritten by the generated default). Suggested resolution: port the override support (the serverReadyAction === undefined guard in dotnet.ts) to release/13.5, or retarget this documentation to the branch/release where the override actually ships. The "generated default" paragraph (verified) is accurate and can stay.
Reviewed head SHA 2e8a9a725e00bc1e43fb1addd00669c0913e5082. Phase A read microsoft/aspire@release/13.5: extension/src/debugger/{languages/dotnet.ts, debuggerExtensions.ts, launchProfiles.ts, test/dotnetDebugger.test.ts}.
| "project": { | ||
| "serverReadyAction": { | ||
| "action": "openIntegratedBrowser", | ||
| "pattern": "Now listening on:\\s+\\[?(https?://[^\\]\\s]+)" |
There was a problem hiding this comment.
Unverifiable on release/13.5. The value openIntegratedBrowser (and this exact pattern) does not appear anywhere in the extension source or tests on this branch. The only serverReadyAction action the extension produces or tests on release/13.5 is openExternally (extension/src/debugger/launchProfiles.ts:380). This exact example — action: 'openIntegratedBrowser' with pattern: 'Now listening on:\\s+\\[?(https?://[^\\]\\s]+)' — is present only on main (e.g. extension/src/test/dotnetDebugger.test.ts), which is additional evidence that the override feature this example illustrates has not yet shipped in release/13.5.
There was a problem hiding this comment.
Backport PR in microsoft/aspire#19451. This is doc change was a bit of a gray area because the VS Code extension releases independently from main, but we had already branched for 13.5 before the change reflected in this documentation was merged. As a result, the latest extension release includes the change, but 13.5 itself does not.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
David Pine (IEvangelist)
left a comment
There was a problem hiding this comment.
🤖 Automated docs-accuracy review — ⚠️ changes requested (revision 4a97126)
Phase A source of truth: microsoft/aspire @ release/13.5 (SHA e076d8e427cb3afb528dbd605acd74c3aea69f94) — the branch this PR targets. Cross-checked main (SHA 7adcc4c92d9c48d96050096a2c37afb0ee7ba219) only to locate where the underlying fix lives.
Claims: 6 non-narrative → ❌ 1 contradicted ·
Phase B (doc-tester): exercised /get-started/aspire-vscode-extension/ on a local dev server serving this revision — page renders (HTTP 200), 0 critical, 0 warnings.
Headline (re-review of the updated revision)
Thanks for the update — the new AppHost behavior note is accurate (verified below). However, the core issue from the previous review still stands: on release/13.5 a user-supplied debuggers.project.serverReadyAction is silently overwritten for project resources, so the documented override does not take effect on the branch this PR targets. The fix that makes the override work (and that stops the extension generating a default at all) lives on main (source PR #19200, milestone 13.6), not on release/13.5. See the two inline comments.
Verdict: REQUEST_CHANGES — one contradicted claim (the override) plus an unverifiable action value. Suggested resolution (unchanged): retarget this doc to the release where #19200 ships, or wait until the fix is on release/13.5.
Phase A — Claim verification
Two inline comments are anchored to the affected lines.
✅ Verified / 🟡 verified-with-nuance claims (4) with evidence
All evidence is microsoft/aspire@release/13.5.
- D1 — "For
project, the extension normally generates aserverReadyActionfromlaunchSettings.jsonto automatically open the browser." 🟡 verified-with-nuance.extension/src/debugger/languages/dotnet.ts:451-452sets it for non-apphost resources viadetermineServerReadyAction(...);extension/src/debugger/launchProfiles.ts:368-384returns{ action: "openExternally", pattern: "\\bNow listening on:\\s+https?://\\S+", uriFormat }only whenlaunchBrowser === trueandapplicationUrlis present. Nuance: the generated action isopenExternally(external browser), and none is produced for the AppHost itself (dotnet.ts:451guards!isApphost). - D4 — example
pattern"\\bNow listening on:\\s+(https?://\\S+)". 🟡 verified-with-nuance. Matches the generated default patternlaunchProfiles.ts:381("\\bNow listening on:\\s+https?://\\S+"); the example just adds a capture group. Fine. - D5 — "A .NET AppHost also uses the
projectdebugger, sodebuggers.project.serverReadyActionis included in its debug configuration." ✅ verified. The AppHost is handled byprojectDebuggerExtension(dotnet.ts:396resourceType: 'project'), andextension/src/debugger/debuggerExtensions.ts:75-76appliesdebuggers[launchConfig.type](i.e.debuggers['project']) for it. - D6 — "If you set both
debuggers.apphost.serverReadyActionanddebuggers.project.serverReadyAction, theprojectvalue takes precedence." ✅ verified.debuggerExtensions.ts:70-77Object.assignsdebuggers['apphost']first (line 71) thendebuggers['project'](line 76), soprojectwins; and for the AppHost the callback skips the generated overwrite (dotnet.ts:451), so the mergedprojectvalue survives.
Phase B — Doc-tester results (blind "new user" pass, no source consulted)
Route exercised: /get-started/aspire-vscode-extension/ (served from a local Astro dev server with this revision's content).
✅ Passed checks
- Page compiles, returns HTTP 200 (title "Aspire Visual Studio Code extension | Aspire"), 0 browser console errors.
- New paragraph renders with correct inline-code formatting; the
:::note[AppHost behavior]renders as a callout with the precedence sentence. - The new JSON block renders with title ".vscode/launch.json — override debuggers.project.serverReadyAction", correct highlighting and a working copy button, placed logically between the
debuggers-keys paragraph and the followingenv/argsparagraph.
🔴 Critical issues
- None (rendering).
⚠️ Warnings
- None (rendering).
💡 Recommendations / knowledge gaps (minor, non-blocking)
- The allowed
actionvalues aren't enumerated, so a reader can't tell what is valid besides theopenIntegratedBrowsershown. - The relationship between the
patterncapture group and the URL the browser opens isn't explained.
Blind-user note: nothing on the rendered page reveals the accuracy problem — it reads as a well-formed, working feature. The mismatch is only detectable by checking the extension source on the target branch (Phase A). This is the intended division of labor between the two phases.
Reviewed head SHA 4a97126da745ea67ffa5ac191beb37db21b2a372. Phase A read microsoft/aspire@release/13.5 extension/src/debugger/{languages/dotnet.ts, debuggerExtensions.ts, launchProfiles.ts}; main consulted only to locate the #19200 fix.
|
|
||
| The `debuggers` property forwards configuration to specific debuggers. Recognized keys are: `apphost`, `project` (C#/.NET), `node`, `python`, `browser`, and `azure-functions`. | ||
|
|
||
| For `project`, the extension normally generates a `serverReadyAction` from the project's `launchSettings.json` to automatically open the browser when the server is ready. Set `debuggers.project.serverReadyAction` explicitly to override this generated default with your own action and pattern: |
There was a problem hiding this comment.
Contradicted on release/13.5. This paragraph says a user can override the generated default, but on this branch that override is discarded for project resources. In extension/src/debugger/debuggerExtensions.ts:51-78 the user's debuggers.project (including serverReadyAction) is merged into the debug configuration before the .NET callback runs; then extension/src/debugger/languages/dotnet.ts:451-452 unconditionally reassigns serverReadyAction = determineServerReadyAction(...) for every non-AppHost project, overwriting the user value. The guard that preserves an explicitly-configured value only exists on main (dotnet.ts comment: "A serverReadyAction the user configured explicitly in launch.json is still respected … never overwritten here"), where the extension also no longer generates one from launchSettings.json at all. So on release/13.5 this describes behavior that doesn't ship yet — retarget to the release carrying microsoft/aspire#19200, or hold until it lands on release/13.5.
(Note: the override does survive for the AppHost, because dotnet.ts:451 skips the generated action when isApphost — which is why the AppHost note below is accurate. But the "override this generated default" scenario is the project case, where it's overwritten.)
| "debuggers": { | ||
| "project": { | ||
| "serverReadyAction": { | ||
| "action": "openIntegratedBrowser", |
There was a problem hiding this comment.
openIntegratedBrowser can't be verified as a valid action. It has zero occurrences in microsoft/aspire@release/13.5, and the extension's own ServerReadyAction type (extension/src/debugger/launchProfiles.ts:362-366) declares action: "openExternally" — which is also the only action the extension ever generates (launchProfiles.ts:380). serverReadyAction is ultimately consumed by VS Code core, but nothing in the Aspire extension produces or recognizes openIntegratedBrowser, so this example is likely to mislead. Consider using openExternally (the value the generated default uses), or documenting the exact set of supported action values.
Adam Ratzman (adamint)
left a comment
There was a problem hiding this comment.
I do not have anything to add beyond the existing review threads.
Documents changes from microsoft/aspire#19200
@ellahathawayTargeting
release/13.5— the latest release branch onmicrosoft/aspire.dev— becauserelease/13.6(from the source PR milestone13.6) does not exist there.Why
The source PR fixes a bug where the VS Code extension replaced an explicitly configured
debuggers.project.serverReadyActionwith the action generated fromlaunchSettings.json, preventing users from overriding the default browser-opening behavior. The generatedserverReadyActionis now treated as a default, and any user-provided value is preserved.What changed
src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdxto document thatproject.serverReadyActioncan be set explicitly to override the generated default, with a JSON example matching the source PR's user-facing usage snippet.Files modified
src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdx(updated, existing page)